﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace AppFramework.Migrations
{
    public partial class UniqueIdCodemodel : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "tb_UniqueIdCode",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Barcode = table.Column<string>(type: "varchar(200)", nullable: false, comment: "条码"),
                    Barcodestandard = table.Column<string>(type: "varchar(20)", nullable: false, comment: "条码格式"),
                    Barcodetype = table.Column<string>(type: "varchar(20)", nullable: true, comment: "条码类型"),
                    Materialnumber = table.Column<string>(type: "varchar(40)", nullable: false, comment: "物料编号"),
                    Materialname = table.Column<string>(type: "varchar(20)", nullable: false, comment: "物料名称"),
                    State = table.Column<bool>(type: "bit", nullable: false),
                    Barcodecontent = table.Column<string>(type: "varchar(40)", nullable: true, comment: "条码内容"),
                    Remark = table.Column<string>(type: "varchar(200)", nullable: true, comment: "备注"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false),
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CreatorUserId = table.Column<long>(type: "bigint", nullable: true),
                    LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    LastModifierUserId = table.Column<long>(type: "bigint", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("主键", x => x.Id);
                });

            migrationBuilder.CreateIndex(
                name: "IX_tb_UniqueIdCode_Barcodetype",
                table: "tb_UniqueIdCode",
                column: "Barcodetype");

            migrationBuilder.CreateIndex(
                name: "IX_tb_UniqueIdCode_State",
                table: "tb_UniqueIdCode",
                column: "State");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "tb_UniqueIdCode");
        }
    }
}
